Skip to content

Conversation

@sAchin-680
Copy link
Contributor

@sAchin-680 sAchin-680 commented Nov 6, 2025

Key Features:

  • Optional example_configs field in metadata.yaml supporting multiple named examples
  • Auto-generated documentation section showing example configurations
  • Auto-generated validation tests ensuring examples are valid YAML
  • Examples include name, description, and YAML configuration content

Changes:

  • Add ExampleConfig struct and example_configs field to metadata schema
  • Update documentation template to render example configurations section
  • Generate TestExampleConfigs to validate example YAML syntax
  • Fix unused import in config_test.go.tmpl (conditional confmap import)
  • Add example configurations to samplereceiver and samplescraper as demos

Link to tracking issue

Addresses #14066 - Automate validation and fulfillment of criteria outlined in the "Component Stability" document
Fixes #14097 - Ensure all components have at least one sample configuration

Testing

  • All existing tests pass (34 files updated, all tests green)
  • New TestExampleConfigs validates each example configuration is valid YAML
  • Documentation correctly renders example configurations with proper formatting
  • Tested with multiple examples per component (samplereceiver: 3 examples, samplescraper: 1 example)

Documentation

  • Updated metadata-schema.yaml with example_configs field documentation and usage examples
  • Example configurations automatically render in generated documentation.md files
  • Each example includes descriptive name and use-case description for clarity

Changes:
- Add ExampleConfig struct and example_configs field to metadata schema
- Update documentation template to render example configurations
- Generate validation tests for example configurations (YAML syntax check)
- Fix unused import in config_test.go.tmpl (conditional import of confmap)
- Add example configurations to samplereceiver and samplescraper

Addresses requirement from issue open-telemetry#14066 to automate validation and
fulfillment of component stability documentation criteria.

Testing:
- All existing tests pass
- New TestExampleConfigs validates example configurations are valid YAML
- Documentation correctly renders example configurations

Signed-off-by: SACHIN KUMAR <[email protected]>
@sAchin-680 sAchin-680 requested review from a team and dmitryax as code owners November 6, 2025 07:54
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (c503bb1) to head (d7a0f02).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14133      +/-   ##
==========================================
- Coverage   92.25%   92.21%   -0.04%     
==========================================
  Files         658      658              
  Lines       41168    41168              
==========================================
- Hits        37978    37963      -15     
- Misses       2183     2193      +10     
- Partials     1007     1012       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure all components have at least one sample configuration

1 participant